import request from '@/plugin/axios'
import { sysPath }from '@api/sys.common'


export function getOrderInfoByPage(data){
    return request({
        url: sysPath+'/hx-mart/api/v1/order/orderInfo/getOrderInfoByPage',
        method: 'post',
        data
    })
}

export function getAllOrderInfoByPage(data){
    return request({
        url: sysPath+'/hx-mart/api/v1/order/orderInfo/pageAll',
        method: 'post',
        data
    })
}

export function queryOrderDetailByOrderId(params){
    return request({
        url: sysPath+'/hx-mart/api/v1/order/orderInfo/queryOrderDetailByOrderId',
        method: 'get',
        params
    })
}

export function queryRefundStatistics(params){
    return request({
        url: sysPath+'/hx-mart/api/v1/order/orderInfo/queryRefundStatistics',
        method: 'get',
        params
    })
}

export function getOrderRefundByPage(params){
   
    return request({
        url: sysPath+'/hx-mart/api/v1/order/orderInfo/getOrderRefundByPage',
        method: 'get',
        params
    })
}

export function OrderRefundApply(data){
    return request({
        url: sysPath+'/hx-mart/api/v1/order/orderInfo/orderRefundApply',
        method: 'post',
        data
    })
}

export function OrderRefundSubmit(params){
    return request({
        url: sysPath+'/hx-mart/api/v1/order/ccb/refund',
        method: 'post',
        params
    })
}

export function OrderRefundInfo(params){
    return request({
        url: sysPath+'/hx-mart/api/v1/order/ccb/refund/query',
        method: 'post',
        params
    })
}

export function QueryOrderRefund(params){
    return request({
        url: sysPath+'/hx-mart/api/v1/order/orderInfo/queryOrderRefund',
        method: 'get',
        params
    })
}

export function exportOrderInfo(data){ 
    return request({
        url: sysPath + '/hx-mart/api/v1/order/orderInfo/exportOrderInfo',
        method: 'post',
        responseType: 'blob',
        data         // json参数需要添加data:
    })
}

export function exportOrderDetail(data){ 
    return request({
        url: sysPath + '/hx-mart/api/v1/order/orderInfo/detail/export/shop',
        method: 'post',
        responseType: 'blob',
        data         // json参数需要添加data:
    })
}

export function exportAllOrderInfo(data){ 
    return request({
        url: sysPath + '/hx-mart/api/v1/order/orderInfo/export/channels',
        method: 'post',
        responseType: 'blob',
        data         // json参数需要添加data:
    })
}

export function exportAllOrderDetail(data){ 
    return request({
        url: sysPath + '/hx-mart/api/v1/order/orderInfo/detail/export/channels',
        method: 'post',
        responseType: 'blob',
        data         // json参数需要添加data:
    })
}

export function exportOrderRefundList(params){ 
    return request({
        url: sysPath + '/hx-mart/api/v1/order/orderInfo/exportOrderRefundList',
        method: 'get',
        responseType: 'blob',
        params
    })
}

// 撤销申请
export function orderRefundCancel(params){
    return request({
        url: sysPath+'/hx-mart/api/v1/order/orderInfo/refund/cancel',
        method: 'post',
        params
    })
}

// 确认退款
export function orderRefundDone(params){
    return request({
        url: sysPath+'/hx-mart/api/v1/order/orderInfo/refund/done',
        method: 'post',
        params
    })
}

// 确认退货入库
export function orderReturnStockInDone(params){
    return request({
        url: sysPath+'/hx-mart/api/v1/order/orderInfo/returnStockIn/done',
        method: 'post',
        params
    })
}

export function queryOrderRefundList(params){
    return request({
        url: sysPath+'/hx-mart/api/v1/order/orderInfo/queryOrderRefundList',
        method: 'get',
        params
    })
}

// 订单数据统计
export function getOrderSummaryData(data){
    return request({
        url: sysPath+'/admin/v1/mart/data/order/sale/statistics',
        method: 'post',
        data
    })
}

//兑换订单
export function getExchangeOrderList(data){
    return request({
        url: sysPath+'/hx-mart/api/v1/coupon/exchange/page',
        method: 'post',
        data
    })
}
